# -*- coding: utf-8 -*-
__author__ = 'ggcall'
from PIL import Image



for x in range(1000,1010):
    print x
    img=Image.open('%s.jpg'%x).convert('L')
    # t=45
    # table=[]
    # for i in range(256):
        # table.append(0) if i<t else table.append(1)
    # img.point(table,"1").save('%s.1.jpg'%x)
    img.point(lambda i: 0 if i < 45 else 1, '1').save('%s.1.jpg'%x)
